<?
/*
 * Copyright 2004-2005 Sigve Indregard.
 *
 * This file is part of Laivsys.
 *
 * Laivsys is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * Laivsys is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Laivsys; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

/*
 * $Id: roller_fixkamptall.php 6 2005-07-11 23:14:47Z say $
 */
 
include("../db.php");
include("auth.php");
include("top.php");
include("rollerinclude.php");
rollermeny();

if ($_REQUEST['process'] == 'true') {
	$tve=$_REQUEST['tve'];
	$neve=$_REQUEST['neve'];
	
	foreach ($tve as $id => $tall) {
		$sql="UPDATE r_Rolle SET nevekamptall=".$neve[$id].", tvekamptall=$tall WHERE ID=$id";
		mysql_query($sql);
	}
}

$sql="SELECT ID, rollekode, nevekamptall, tvekamptall FROM r_Rolle WHERE LaivID=$laivid ORDER BY rollekode";
$roller=mysql_query($sql);

?>
<h2>Roller - fix kamptall</h2>
<table border=1>
<form method="post" action="roller_fixkamptall.php">
<input type="hidden" name="process" value="true">
	<tr>
	<td>Navn</td>
	<td>Neve</td>
	<td>Tve</td>
	</tr>
<?


while ($rolle=mysql_fetch_assoc($roller)) {
	?>
	<tr>
	<td><?=$rolle['rollekode']?></td>
	<td><input name="neve[<?=$rolle['ID']?>]" size="3" value="<?=$rolle['nevekamptall']?>"></td>
	<td><input name="tve[<?=$rolle['ID']?>]" size="3" value="<?=$rolle['tvekamptall']?>"></td>
	</tr>
	<?
}

?>
</table>
<input type="submit" value="Oppdater base">
</form>
<?
include("bottom.php");
?>
